<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
use App\Http\Middleware\SignVerify;

//Route::get('/', function () {
//    return view('welcome');
//});

Route::get('/logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');

Route::any('/hooks',function(){
//	echo exec('whoami');
//	$www_folder = "/usr/share/nginx/huicheng_api" ;
//	//git仓库地址
//	$git_repo = "git@git.oschina.net:qxr/huicheng_api.git master:master";
//	//执行指令
//	echo shell_exec(" cd $www_folder && git pull $git_repo 2>&1 ");
	echo shell_exec('./hooks.sh');
});


// 验证ticket中间件重定向
Route::any('sign_verify_failed', function () {
	return json_error('请求签名错误');
})->name('sign_verify_failed');


Route::group(['middleware'=>[SignVerify::class],'domain' => 'api.' . env('APP_DOMAIN')], function () {
	Route::any('/', function () {
		$_cmd = request('_cmd');
		$param = request()->except(['s']);
		clear_null($param);
		$controller = strstr($_cmd, '_', true);
		$action = substr(strstr($_cmd, '_'), 1);
		return curl_post('http://'.request()->server('HTTP_HOST').'/'.$controller.'/'.$action,$param);
//		return call_user_func(['\\App\\Http\\Controllers\\'.$controller.'Controller',$action],new \App\Http\Requests\BasicRequest());
	});
	
	// 主控制
	Route::group(['prefix' => 'common'],function(){
		Route::any('area_select','CommonController@area_select');
		Route::any('area_json','CommonController@area_json');
	});
	
	// 首页
	Route::group(['prefix' => 'index'],function(){
		Route::any('test','IndexController@test');
		Route::any('loading_img','IndexController@loading_img');
		Route::any('app_update_client','IndexController@app_update_client');
		Route::any('app_update_company','IndexController@app_update_company');
		Route::any('app_update_store','IndexController@app_update_store');
		Route::any('index','IndexController@index');
		Route::any('city','IndexController@city');
		Route::any('city_house','IndexController@city_house');
		Route::any('news','IndexController@news');
		Route::any('unview_message_count','IndexController@unview_message_count');
		Route::any('message_update','IndexController@message_update');
        Route::any('goods_list','IndexController@goods_list');
		// 我的业委
		Route::any('council_publicity','IndexController@council_publicity');
		Route::any('council_complaints_last','IndexController@council_complaints_last');
		Route::any('council_complaints_create','IndexController@council_complaints_create');
		Route::any('council_complaints_history','IndexController@council_complaints_history');
		Route::any('council_complaints_detail','IndexController@council_complaints_detail');
		Route::any('council_complaints_create','IndexController@council_complaints_create');
		Route::any('council_complaints_complete','IndexController@council_complaints_complete');
		Route::any('council_complaints_parent','IndexController@council_complaints_parent');
		Route::any('council_complaints_parent_submit','IndexController@council_complaints_parent_submit');
		Route::any('council_survey','IndexController@council_survey');
		Route::any('council_survey_detail','IndexController@council_survey_detail');
		Route::any('council_survey_submit','IndexController@council_survey_submit');
		Route::any('council_list','IndexController@council_list');
		
		// 物业服务
		Route::any('service_team','IndexController@service_team');
		Route::any('service_image','IndexController@service_image');

		//提现通知
        Route::any('withdraw_confirm','IndexController@withdraw_confirm');
        Route::any('store_confirm','IndexController@store_confirm');
	});
	//便民
        Route::group(['prefix' => 'convenient'],function(){
        Route::any('index','ConvenientController@index');
        Route::any('category','ConvenientController@category');
        Route::any('store_list','ConvenientController@store_list');
        Route::any('store_detail','ConvenientController@store_detail');
        Route::any('appraise_list','ConvenientController@appraise_list');
        Route::any('goods_list','ConvenientController@goods_list');
        Route::any('recommend_goods','ConvenientController@recommend_goods');
        Route::any('recommend_store','ConvenientController@recommend_store');
        Route::any('search','ConvenientController@search');

    });
    // 商品
    Route::group(['prefix' => 'shop'],function(){
        Route::any('seckill_list','ShopController@seckill_list');
        Route::any('group_list','ShopController@group_list');
        Route::any('goods_detail','ShopController@goods_detail');
        Route::any('goods_collection','ShopController@goods_collection');
        Route::any('goods_collection_list','ShopController@goods_collection_list');

    });

    //订单部分
    Route::group(['prefix' => 'order'],function() {
        Route::any('list', 'OrderController@order_list');
        Route::any('service_list', 'OrderController@service_list');
        Route::any('buy_status', 'OrderController@buy_status');
        Route::any('cart_buy_status', 'OrderController@cart_buy_status');
        Route::any('buy', 'OrderController@buy');
        Route::any('buy_cart', 'OrderController@buy_cart');
        Route::any('pay', 'OrderController@pay');
        Route::any('service_pay', 'OrderController@service_pay');
        Route::any('detail', 'OrderController@detail');
        Route::any('editOrder', 'OrderController@editOrder');
        Route::any('cancel', 'OrderController@cancel');
        Route::any('confirm', 'OrderController@confirm');
        Route::any('del', 'OrderController@del');
        Route::any('express', 'OrderController@express');
        Route::any('getPayment', 'OrderController@getPayment');
        Route::any('status', 'OrderController@status');
        Route::any('service_status', 'OrderController@service_status');
        Route::any('refund_reason', 'OrderController@refund_reason');
        Route::any('refund', 'OrderController@refund');
        Route::any('refund_order', 'OrderController@refund_order');
        Route::any('refund_info', 'OrderController@refund_info');
        Route::any('refund_edit', 'OrderController@refund_edit');
        Route::any('refund_handle', 'OrderController@refund_handle');
        Route::any('getStoreID', 'OrderController@getStoreID');
        Route::any('appraise', 'OrderController@order_appraise');
        Route::any('appraise_tag', 'OrderController@appraise_tag');
        Route::any('cart_check', 'OrderController@cart_check');
        Route::any('service_store_info', 'OrderController@service_store_info');
    });
	// 上传
	Route::group(['prefix' => 'upload'],function(){
		Route::any('image','UploadController@image');
		Route::any('image_form','UploadController@image_form');
		Route::any('file','UploadController@file');
	});
	
	// 用户部分
	Route::group(['prefix' => 'user'],function(){
		Route::any('info','UserController@info');
		Route::any('login','UserController@login');
		Route::any('login_wechat','UserController@login_wechat');
		Route::any('logout','UserController@logout');
		Route::any('register','UserController@register');
		Route::any('register_sms','UserController@register_sms');
		Route::any('bind_house','UserController@bind_house');
		Route::any('bind_house_next','UserController@bind_house_next');
		Route::any('bind_house_owner','UserController@bind_house_owner');
		Route::any('bind_house_sms','UserController@bind_house_sms');
		Route::any('bind_house_submit','UserController@bind_house_submit');
		Route::any('password_reset','UserController@password_reset');
		Route::any('password_reset_sms','UserController@password_reset_sms');
	});
	// 用户中心部分
	Route::group(['prefix' => 'usercenter'],function(){
		Route::any('index','UsercenterController@index');
		Route::any('info','UsercenterController@info');
		Route::any('house_switch','UsercenterController@house_switch');
		Route::any('avatar_update','UsercenterController@avatar_update');
		Route::any('username_update','UsercenterController@username_update');
		Route::any('gender_update','UsercenterController@gender_update');
		Route::any('email_update','UsercenterController@email_update');
		Route::any('house','UsercenterController@house');
		Route::any('house_costs_unpaid','UsercenterController@house_costs_unpaid');
		Route::any('house_costs_paid','UsercenterController@house_costs_paid');
		Route::any('house_costs_detail','UsercenterController@house_costs_detail');
		Route::any('house_costs_confirm','UsercenterController@house_costs_confirm');
		Route::any('house_costs_pay','UsercenterController@house_costs_pay');
		Route::any('house_manager','UsercenterController@house_manager');
		Route::any('house_manager_feedback_tags','UsercenterController@house_manager_feedback_tags');
		Route::any('house_manager_feedback_submit','UsercenterController@house_manager_feedback_submit');
		Route::any('house_manager_viewed','UsercenterController@house_manager_viewed');
		Route::any('message_type','UsercenterController@message_type');
		Route::any('message_list','UsercenterController@message_list');
		Route::any('message_detail','UsercenterController@message_detail');
		Route::any('advisory','UsercenterController@advisory');
		Route::any('complaints','UsercenterController@complaints');
		Route::any('favorite','UsercenterController@favorite');
		Route::any('neighbor_help','UsercenterController@neighbor_help');
		Route::any('address','UsercenterController@address');
		Route::any('address_detail','UsercenterController@address_detail');
		Route::any('address_add','UsercenterController@address_add');
		Route::any('address_edit','UsercenterController@address_edit');
		Route::any('address_del','UsercenterController@address_del');
		Route::any('neighbor','UsercenterController@neighbor');
		Route::any('password_reset','UsercenterController@password_reset');
	});
	
	// 邻里圈
	Route::group(['prefix'=>'neighbor'],function(){
		Route::any('type','NeighborController@type');
		Route::any('share','NeighborController@share');
		Route::any('share_mine','NeighborController@share_mine');
		Route::any('share_create','NeighborController@share_create');
		Route::any('carpool','NeighborController@carpool');
		Route::any('carpool_create','NeighborController@carpool_create');
		Route::any('renting','NeighborController@renting');
		Route::any('renting_create','NeighborController@renting_create');
		Route::any('oldstuff','NeighborController@oldstuff');
		Route::any('oldstuff_create','NeighborController@oldstuff_create');
		Route::any('activity','NeighborController@activity');
		Route::any('activity_create','NeighborController@activity_create');
		Route::any('help_mutual','NeighborController@help_mutual');
		Route::any('info_index','NeighborController@info_index');
		Route::any('info_type','NeighborController@info_type');
		Route::any('info','NeighborController@info');
		Route::any('info_detail','NeighborController@info_detail');
		
		// 公共添加/详情/评论/赞/删除(撤销)
		Route::any('help_create','NeighborController@help_create');
		Route::any('help_detail','NeighborController@help_detail');
		Route::any('help_comment_list','NeighborController@help_comment_list');	// 评论列表
		Route::any('help_comment_create','NeighborController@help_comment_create');		// 提交评论
		Route::any('help_commend_create','NeighborController@help_commend_create');		// 提交赞
		Route::any('help_delete','NeighborController@help_delete');
	});
	
	
	/***************************************** 物业版部分 ****************************************************************************/
	Route::group(['namespace'=>'Company','prefix'=>'company'],function(){
		// 用户登录/登出
		Route::any('user_login','UserController@login');
		Route::any('user_logout','UserController@logout');
		Route::any('monitor_index','monitorController@index');

        //组织机构
        Route::any('department_team_list','DepartmentController@team_list');
        Route::any('department_team_detail','DepartmentController@team_detail');
        Route::any('department_team_user','DepartmentController@team_user');
        //内部沟通
        Route::any('manage_message_list','ManageMessageController@list');
        Route::any('manage_message_detail','ManageMessageController@detail');
        Route::any('manage_message_send','ManageMessageController@send');
        //工单
        Route::any('manage_work_list','ManageWorkController@list');
        Route::any('manage_work_detail','ManageWorkController@detail');
        Route::any('manage_work_type','ManageWorkController@type');
        Route::any('manage_work_create','ManageWorkController@create');
        Route::any('manage_work_confirm','ManageWorkController@confirm');
        Route::any('manage_work_rongcloud','ManageWorkController@rongcloud');
		// 用户中心
		Route::any('usercenter_index','UsercenterController@index');
		Route::any('usercenter_work','UsercenterController@work');
		Route::any('usercenter_my_work','UsercenterController@my_work');
		Route::any('usercenter_work_create','UsercenterController@work_create');
		Route::any('usercenter_work_detail','UsercenterController@work_detail');
		Route::any('usercenter_work_del','UsercenterController@work_del');
		Route::any('usercenter_integral','UsercenterController@integral');
		Route::any('usercenter_integral_type','UsercenterController@integral_type');
		Route::any('usercenter_get_level','UsercenterController@get_level');
		
		// 业主通讯录
		Route::any('contacts_index','ContactsController@index');
		Route::any('contacts_house_list','ContactsController@contacts_house_list');
		Route::any('contacts_detail','ContactsController@detail');
		Route::any('contacts_message','ContactsController@message');
		Route::any('contacts_message_submit','ContactsController@message_submit');
		Route::any('contacts_create_client','ContactsController@create_client');
		Route::any('contacts_create_family','ContactsController@create_family');
		
		// 我的工作
		Route::any('work_index','WorkController@index');
		Route::any('work_switch','WorkController@switch');
		Route::any('work_rongcloud','WorkController@rongcloud');
		Route::any('service_list','WorkController@service_list');
		Route::any('work_rongcloud_viewed','WorkController@rongcloud_viewed');
		Route::any('work_rongcloud_complete','WorkController@rongcloud_complete');
		Route::any('work_costs','WorkController@costs');
		Route::any('work_costs_list','WorkController@costs_list');
		Route::any('work_costs_filter','WorkController@costs_filter');
		Route::any('work_costs_unpaid','WorkController@costs_unpaid');
		Route::any('work_costs_paid','WorkController@costs_paid');
		Route::any('work_costs_message','WorkController@costs_message');
		Route::any('work_duty','WorkController@duty');
		Route::any('work_duty_filter','WorkController@duty_filter');
		Route::any('work_duty_work','WorkController@duty_work');
		Route::any('work_isworking','WorkController@isworking');

		Route::any('work_complaints','WorkController@complaints');
		Route::any('work_complaints_detail','WorkController@complaints_detail');
		Route::any('work_complaints_reply','WorkController@complaints_reply');
		Route::any('work_complaints_complete','WorkController@complaints_complete');
		//值班
        Route::any('duty_index','DutyController@index');
        Route::any('duty_start','DutyController@start');
	});

	//商家板部分
	Route::group(['namespace'=>'Store','prefix'=>'store'],function(){
		// 登录注册
		Route::any('login','UserController@login');
		Route::any('register','UserController@register');
		Route::any('logout','UserController@logout');
		Route::any('datum','UserController@datum');
		Route::any('register_master','UserController@register_master');
		Route::any('register_store','UserController@register_store');
		Route::any('register_village','UserController@register_village');
		Route::any('password_reset','UserController@password_reset');
		Route::any('password_reset_sms','UserController@password_reset_sms');

		//首页
		Route::any('index','IndexController@index');
		Route::any('get_info','IndexController@get_info');
		Route::any('edit_info','IndexController@edit_info');
		Route::any('edit_shipping','IndexController@edit_shipping');
        Route::any('statistics','IndexController@statistics');

		//商品管理
		Route::any('goods_index','GoodsController@index');
		Route::any('goods_list','GoodsController@goods_list');
		Route::any('change_sale','GoodsController@change_sale');
		Route::any('goods_detail','GoodsController@goods_detail');
		Route::any('goods_edit','GoodsController@goods_edit');
		Route::any('goods_edit_one','GoodsController@goods_edit_one');
		Route::any('goods_edit_two','GoodsController@goods_edit_two');
		Route::any('goods_edit_three','GoodsController@goods_edit_three');
		Route::any('goods_edit_four','GoodsController@goods_edit_four');

        //分类管理
        Route::any('category','GoodsController@category');
        Route::any('category_edit','GoodsController@category_edit');
        Route::any('category_del','GoodsController@category_del');

        //客户管理
		Route::any('client_list','ClientController@client_list');

		//订单管理
		Route::any('order_list','OrderController@order_list');
		Route::any('order_detail','OrderController@order_detail');
		Route::any('order_express','OrderController@express');
		Route::any('order_del','OrderController@order_del');
		Route::any('order_refund','OrderController@order_refund');
		Route::any('order_send','OrderController@send');
		Route::any('order_service_send','OrderController@service_send');
		Route::any('order_express_company','OrderController@express_company');

        //退款
        Route::any('refund_info','OrderController@refund_info');
        Route::any('refund_confirm','OrderController@refund_confirm');

        //资产
        Route::any('account_index','AccountController@index');
        Route::any('account_withdraw','AccountController@withdraw');
        Route::any('account_withdraw_submit','AccountController@withdraw_submit');
        Route::any('account_withdraw_list','AccountController@withdraw_list');
        Route::any('account_split_list','AccountController@split_list');

        //消息通知
        Route::any('messages_type','MessageController@messages_type');
        Route::any('messages_list','MessageController@messages_list');
        Route::any('messages_detail','MessageController@messages_detail');
	});
});

// 支付回调，微信/支付宝
Route::group(['prefix'=>'notify'],function(){
	Route::any('wechat','NotifyController@wechat');
	Route::any('alipay','NotifyController@alipay');
});
// 订单支付回调，微信/支付宝
Route::group(['prefix'=>'orderNotify'],function(){
    Route::any('wechat','OrderNotifyController@wechat');
    Route::any('alipay','OrderNotifyController@alipay');
});
// 接口沙盒调试
Route::group(['prefix' => 'sandbox'],function(){
	Route::any('/','SandboxController@index');
	Route::any('test','SandboxController@test');
	Route::any('index','SandboxController@index');
	Route::post('submit','SandboxController@submit');
});

// webview 网页部分
Route::group(['prefix'=>'webview'],function(){
	Route::any('service_type','WebviewController@service_type');
	Route::any('service_about','WebviewController@service_about');
	Route::any('service_team','WebviewController@service_team');
	Route::any('service_content','WebviewController@service_content');
	Route::any('service_publicity','WebviewController@service_publicity');
	Route::any('service_publicity_detail','WebviewController@service_publicity_detail');
	Route::any('service_list','WebviewController@service_list');
	Route::any('service_detail','WebviewController@service_detail');
	Route::any('service_process','WebviewController@service_process');
	Route::any('service_process_detail','WebviewController@service_process_detail');
	Route::any('service_laws','WebviewController@service_laws');
	Route::any('service_laws_detail','WebviewController@service_laws_detail');
	Route::any('service_survey','WebviewController@service_survey');
	Route::any('service_question','WebviewController@service_question');
	Route::any('service_question_detail','WebviewController@service_question_detail');
	Route::any('neighbor_info_detail','WebviewController@neighbor_info_detail');
	Route::any('messages_type','WebviewController@messages_type');
	Route::any('messages_list','WebviewController@messages_list');
	Route::any('messages_detail','WebviewController@messages_detail');
	Route::any('complaints_history','WebviewController@complaints_history');
	Route::any('complaints_detail','WebviewController@complaints_detail');
	Route::any('rongcloud_history','WebviewController@rongcloud_history');
	Route::any('neighbor_detail','WebviewController@neighbor_detail');
	Route::any('about_us','WebviewController@about_us');
	Route::any('about_us_manager','WebviewController@about_us_manager');
	Route::any('news_detail','WebviewController@news_detail');
	Route::any('living_expenses','WebviewController@living_expenses');
	Route::any('download','WebviewController@download');
	//Route::any('download_submit','WebviewController@download_submit');
	Route::any('service_gongshi','WebviewController@service_gongshi');
	Route::any('service_gongshi_detail','WebviewController@service_gongshi_detail');
	Route::any('service_gonggao','WebviewController@service_gonggao');
	Route::any('service_gonggao_detail','WebviewController@service_gonggao_detail');
	Route::any('service_zhangcheng','WebviewController@service_zhangcheng');
	Route::any('service_zhangcheng_detail','WebviewController@service_zhangcheng_detail');
});

/**
 * 短信中心
 */
Route::group(['domain' => 'api.' . env('APP_DOMAIN')], function () {
	Route::any('msg/message','MsgController@message');	// 实时推送
	Route::any('msg/message_sync','MsgController@message_sync');
	
	Route::any('msg/push','MsgController@push');
	Route::any('msg/push_sync','MsgController@push_sync');		// test 同步推送
});




























































































































































































































































































Route::get('/', function () {
	return <<<EOF
            <pre>
　　　　　　　┏┓　　　┏┓+ +
　　　　　　┏┛┻━━━┛┻┓ + +
　　　　　　┃　　　　　　　┃ 　
　　　　　　┃　　　━　　　┃ ++ + + +
　　　　　　┃████━████　┃+
　　　　　　┃　　　　　　　┃ +
　　　　　　┃　　　┻　　　┃
　　　　　　┃　　　　　　　┃ + +
　　　　　　┗━┓　　　┏━┛
　　　　　　　　┃　　　┃　　　　　　　　　　　
　　　　　　　　┃　　　┃ + + + +
　　　　　　　　┃　　　┃　　　　Code is far away from bug with the animal protecting
　　　　　　　　┃　　　┃ + 　　　　神兽保佑,代码无bug　　
　　　　　　　　┃　　　┃
　　　　　　　　┃　　　┃　　+　　　　　　　　　
　　　　　　　　┃　 　　┗━━━┓ + +
　　　　　　　　┃ 　　　　　　　┣┓
　　　　　　　　┃ 　　　　　　　┏┛
　　　　　　　　┗┓┓┏━┳┓┏┛ + + + +
　　　　　　　　　┃┫┫　┃┫┫
　　　　　　　　　┗┻┛　┗┻┛+ + + +
EOF;
});